const fs = require("fs")

module.exports = {
    static: function(box){
        return (req, res, next)=>{
            fs.readFile(box + req.url,(err,data)=>{
                if(!err){
                    res.write(data);
                    res.end();
                }else{
                    next()
                }
            })
        }
    }
}